{include file="public_head" /}

<!-- chk_3 -->
<link href="__STATIC__/css/chk_3.css" rel="stylesheet" type="text/css"/>
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">
<body class="nav-md">
<div class="container body">
    <div class="main_container">
        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">
                <div class="page-title">
                    <div class="title_left">
                        <h3>
                            限时抢购商品管理
                        </h3>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}</h2>
                                <a style="float: right" href="{:url('console/Limited/create')}"
                                   class="btn btn-success btn-sm">添加限时抢购商品</a>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <form name="form" id="form" method="get" action="">
                                    <div class="title_left">
                                        <div class="col-md-1 col-sm-3 col-xs-12 form-group pull-left top_search">
                                            <div class="input-group">
                                                <input type="text" class="form-control" name="title"
                                                       placeholder="输入搜索内容..." value="{:input('title')}">
                                            </div>
                                        </div>
                                        <div class="col-md-2 col-sm-3 col-xs-6 form-group pull-left top_search">
                                            <div class="input-group" style="float: left;margin: 0 2%;width: 200px;">

                                                <select name="quot_id" class="select2_single" tabindex="-1">
                                                    <option value="0">- 请选择抢购场次 -</option>

                                                    {volist name='quots' id='quotData'}

                                                    <option value="{$quotData.id}" {eq name=':input("quot_id")' value='$quotData.id'} selected {/eq}>{$quotData.name}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>
                                        <button type="submit" class="btn btn-primary" style="margin-left: 10px;">搜 索</button>
                                    </div>
                                    <table class="table table-striped table-bordered">
                                        <thead>
                                        <tr>
                                            <td><input type="checkbox" class="checkall"
                                                       onclick="CheckAll(this.checked);"/></td>
                                            <th>商品标题</th>
                                            <th>参加抢购场次</th>
                                            <th>售卖价格</th>
                                            <th>抢购价格</th>
                                            <th>抢购数量</th>
                                            <th>已抢数量</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {empty name="data"}
                                        <tr><td colspan="8"><div style='font-size:24px;margin:30px 0;'>没有找到记录</div></td></tr>
                                        {/empty}
                                        {volist name="data" id="item"}
                                        <tr>
                                            <td><input type="checkbox" name="id[]" value="{$item.id}"/></td>
                                            <td>{:reStrLen($item.shop_goods.title,20)}</td>
                                            <td>{$item.QuotName}</td>
                                            <td>{$item.goods_price} 元</td>
                                            <td>{$item.price} 元</td>
                                            <td>{$item.number} </td>
                                            <td>{$item.purchase_number}</td>
                                            <td>
                                                <a href="{:url('Limited/update', ['id' => $item['id']])}"
                                                   class="label label-primary">
                                                    <span class="fa fa-pencil"></span>&nbsp;&nbsp;编 辑
                                                </a>
                                                &nbsp;&nbsp;&nbsp;&nbsp;
                                                <a href="{:url('Limited/destroy', ['id' => $item['id'],'goods_id'=> $item['goods_id']])}"
                                                   class="label label-danger"
                                                   onClick="return confirm('确定删除吗?')"
                                                >
                                                    <span class="fa fa-times"></span>&nbsp;&nbsp;删 除
                                                </a>
                                            </td>
                                        </tr>
                                        {/volist}
                                        </tbody>
                                        <tbody align="left">
                                        <tr>
                                            <td colspan="8">
                                                <span class="selArea"><span>选择：</span>
                                                    <a style="color:#428BCA"
                                                       href="javascript:DelAllNone('{:url(\'Limited/destroy\')}');"
                                                       onclick="return ConfDelAll(0);">选择删除</a>
                                                </span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <!-- 分页 -->
                                    <div style="float: right;margin-top: -30px;">{$data->render()}</div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- /page content -->
    </div>
</div>
{include file="public_foot" /}
<!-- public -->
<script src="__STATIC__/js/public.js"></script>
<!-- layer -->
<script src="__STATIC__/js/layer.js"></script>
<script type="text/javascript">
    // list
    $(document).ready(function () {
        // select2
        $(".select2_single").select2({
            placeholder: "请选择分类",
            allowClear: true
        });
        $(".select2-container").css({width:"80%"})
        $(".form-group:first-of-type .select2-container").css({width:"96%"})
    });
</script>